package JitTest;

import commander.CLI;
import core.JitAdd;
import core.JitBranch;
import core.JitCommit;
import org.junit.Test;


public class test7_JitBranch {
    @Test
    public void test() throws Exception {
        // 初始化仓库
        String[] sInit1 = {"jit","init","C:\\Users\\Alphamxy\\Desktop\\test"};
        CLI.jitInit(sInit1);

        // 初始化本地分支，初次commit
        JitAdd.add("1.txt");
        JitCommit.commit("Init Master");


        System.out.println("=============== Branch_1 ===============");
        // 创建分支Branch_1
        JitBranch.createBranch("Branch_1",true);
        // 在Branch_1分支上commit
        JitAdd.add("2.txt");
        JitCommit.commit("First Time");

        System.out.println("=============== Branch_2 ===============");
        // 创建分支Branch_2
        JitBranch.createBranch("Branch_2",false);
        JitBranch.checkout("Branch_2");
        // 在Branch_2分支上commit
        JitAdd.add("3.txt");
        JitCommit.commit("Second Time");

        System.out.println("=============Print Branches=============");
        JitBranch.printBranches();
    }
}
